import mongoose from 'mongoose';

const userSchema = new mongoose.Schema({
    id: String,
    passwd: String,
    nick_name: String,
    role: String, //none, read, write, create, root
    access_log: [
        {
            _id: false,
            package: String,
            operation: String,
            date: String,
        }
    ],
});

const fileSchema = new mongoose.Schema({
    name: String,
    path: String,
    knowledgeBase: String,
    status: String, //queuing, embedded, error
    ids: [String]
});

const files = mongoose.model('files', fileSchema);
const users = mongoose.model('users', userSchema);

export { users, files };
